From df2ba9e15b85f00c870236d9c2d9375336fa56fd Mon Sep 17 00:00:00 2001 From: "emellor@leeni.uk.xensource.com" Date: Wed, 30 Nov 2005 18:38:14 +0000 Subject: [PATCH] Added the errno to the messages printed with the ERR macro. Tidy the use of this macro where newlines have been appended -- the macro does this itself so there is no need to add another one. Signed-off-by: Ewan Mellor --- tools/libxc/xc_linux_restore.c | 4 ++-- tools/libxc/xc_linux_save.c | 8 ++++---- tools/libxc/xg_save_restore.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/libxc/xc_linux_restore.c b/tools/libxc/xc_linux_restore.c index f25c185abc..95ead19389 100644 --- a/tools/libxc/xc_linux_restore.c +++ b/tools/libxc/xc_linux_restore.c @@ -221,7 +221,7 @@ int xc_linux_restore(int xc_handle, int io_fd, if(xc_domain_memory_increase_reservation( xc_handle, dom, max_pfn, 0, 0, NULL) != 0) { - ERR("Failed to increase reservation by %lx KB\n", PFN_TO_KB(max_pfn)); + ERR("Failed to increase reservation by %lx KB", PFN_TO_KB(max_pfn)); errno = ENOMEM; goto out; } @@ -487,7 +487,7 @@ int xc_linux_restore(int xc_handle, int io_fd, for(k = 0; k < j; k++) { if(!uncanonicalize_pagetable(L1TAB, region_base + k*PAGE_SIZE)) { - ERR("failed uncanonicalize pt!\n"); + ERR("failed uncanonicalize pt!"); goto out; } } diff --git a/tools/libxc/xc_linux_save.c b/tools/libxc/xc_linux_save.c index f91a30b4f3..2d15ee587d 100644 --- a/tools/libxc/xc_linux_save.c +++ b/tools/libxc/xc_linux_save.c @@ -523,13 +523,13 @@ static unsigned long *xc_map_m2p(int xc_handle, xmml.max_extents = m2p_chunks; if (!(xmml.extent_start = malloc(m2p_chunks * sizeof(unsigned long)))) { - ERR("failed to allocate space for m2p mfns!\n"); + ERR("failed to allocate space for m2p mfns"); return NULL; } if (xc_memory_op(xc_handle, XENMEM_machphys_mfn_list, &xmml) || (xmml.nr_extents != m2p_chunks)) { - ERR("xc_get_m2p_mfns:"); + ERR("xc_get_m2p_mfns"); return NULL; } @@ -540,7 +540,7 @@ static unsigned long *xc_map_m2p(int xc_handle, } if (!(entries = malloc(m2p_chunks * sizeof(privcmd_mmap_entry_t)))) { - ERR("failed to allocate space for mmap entries!\n"); + ERR("failed to allocate space for mmap entries"); return NULL; } @@ -794,7 +794,7 @@ int xc_linux_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters, pfn_batch = calloc(MAX_BATCH_SIZE, sizeof(unsigned long)); if ((pfn_type == NULL) || (pfn_batch == NULL)) { - ERR("failed to alloc memory for pfn_type and/or pfn_batch arays."); + ERR("failed to alloc memory for pfn_type and/or pfn_batch arrays"); errno = ENOMEM; goto out; } diff --git a/tools/libxc/xg_save_restore.h b/tools/libxc/xg_save_restore.h index b9a4d38122..7c530b293c 100644 --- a/tools/libxc/xg_save_restore.h +++ b/tools/libxc/xg_save_restore.h @@ -10,7 +10,7 @@ #define PROGRESS 0 #define ERR(_f, _a...) do { \ - fprintf(stderr, _f "\n" , ## _a); \ + fprintf(stderr, _f ": %d\n" , ## _a, errno);\ fflush(stderr); } \ while (0) -- 2.30.2